package com.redis.sdk.cachecore;

import lombok.Data;

import java.util.Timer;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

@Data
public class LockObject {

    private String key;

    private Object value;

    /*
    * 单位秒，等待时间如果是-1则不限制
    * */
    private long waitTime = -1L;

    /**
     * 过期时间
     */
    private long expire;

    /**
     * 单位s
     */
    private TimeUnit timeUnit;

    /**
     * 看门狗
     */
    private ScheduledExecutorService watchDog;

    public LockObject(String key, Object value, long waitTime) {
        this.key = key;
        this.value = value;
        this.waitTime = waitTime;
    }

    public LockObject(String key, Object value) {
        this.key = key;
        this.value = value;
    }
}
